package com.example.demo.mapper;

import org.apache.ibatis.annotations.*;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface SectionMapper {
    /**
     * 增加小节
     * */
    @Insert("insert into section values(default,#{section_name},#{chapter_id},1)")
    public int inssec(String section_name,Integer chapter_id);
    /**
     * 查看小节
     * */
    @Select("select * from section where chapter_id=#{chapter_id}")
    public List<HashMap> selsec(Integer chapter_id);
    /**
     * 更改小节
     * */
    @Update("update section set section_name=#{section_name} where section_id=#{section_id}")
    public int updatesection(String section_name,Integer section_id);

    /**
     * 更改小节状态
     * */
    @Update("update section set section_type=#{section_type} where section_id=#{section_id}")
    public int upsectype(Integer section_type,Integer section_id);
    /**
     * 删除小节
     * */
    @Delete("delete from section where section_id=#{section_id}")
    public int delsec(Integer section_id);
    /***/
}
